#!/home/marvtao/anaconda3/bin/python

import sys
import re
import pandas as pd

def remove_ansi_colors(text):
    ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
    return ansi_escape.sub('', text)

if __name__ == "__main__":
    with open(sys.argv[1]) as file:
        text = file.read()
        text = remove_ansi_colors(text)
        series = pd.Series([int(c.replace("c PROP COUNT: ", "")) for c in text.split("\n") if "PROP" in c])
        print(series.mean())
        print(series.median())
